//
//  BluetoothCenter.h
//  YiJun
//
//  Created by liangrongchang on 2017/4/20.
//  Copyright © 2017年 Rochang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

@protocol BluetoothCenterDelegate <NSObject>
@optional
- (void)bluetoothCenterDidScandPeripheral:(CBPeripheral *)peripheral;

@end

@interface BluetoothCenter : NSObject

@property (nonatomic, weak) id <BluetoothCenterDelegate>delegate;
@property (nonatomic, strong) CBPeripheral *currentPeripheral;
/** 本次里程 */
@property(nonatomic, copy) NSString *currentLu;
/** 速度 */
@property(nonatomic, copy) NSString *speed;
/** 总距离 */
@property(nonatomic, copy) NSString *allLu;
/** 电量 */
@property(nonatomic, copy) NSString *dianliang;
/** 温度 */
@property(nonatomic, copy) NSString *temp;
/** 电流 */
@property(nonatomic, copy) NSString *dianliu;
/** 电压 */
@property(nonatomic, copy) NSString *dianya;
/** 最高车速 */
@property(nonatomic, copy) NSString *maxSpeed;
/** 动力强度 */
@property(nonatomic, copy) NSString *strong;
/** 转向灵敏 */
@property(nonatomic, copy) NSString *turn;
/** 车辆检测 */
@property(nonatomic, copy) NSString *check;
/** 骑行模式 */
@property(nonatomic, copy) NSString *rideMode;
/** 充电状态 */
@property(nonatomic, copy) NSString *chargeMode;
/** 本次开机时间 */
@property(nonatomic, copy) NSString *openTime;
/** 反馈定时时间 */
@property(nonatomic, copy) NSString *setTime;
/** 系统反馈报警速度 */
@property(nonatomic, copy) NSString *alertSpeed;

/** 蓝牙是否打开 */
@property (nonatomic, assign) BOOL isBluetoothOpen;
/** 是否连接设备 */
@property (nonatomic, assign) BOOL isConnectPeripheral;

/** 单例 */
+ (instancetype)shareInstance;
/** 扫描设备 */
- (void)scanperipheral;
/** 连接外设 */
- (void)connetPeripheral:(CBPeripheral *)peripheral;

/** 停止扫描 */
- (void)stopScand;

#pragma mark - wirte
/** 设置开关 */
- (BOOL)setupTurn:(BOOL)turnon;
/** 修改名字 */
- (BOOL)setupName:(NSString *)name;
/** 修改密码 */
- (BOOL)setupPassWord:(NSString *)name;
/** 设置最大速度 */
- (BOOL)setupMaxSpeed:(int)value;
/** 设置动力强度 */
- (BOOL)setupStrong:(int)value;
/** 设置转向灵敏度 */
- (BOOL)setupTurnStrong:(int)value;
/** 定时关机 */
- (BOOL)setupTime:(int)value;


@end

